package com.zhilianzhonghe.jinyu.dialog;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Handler;
import android.os.Message;
import android.widget.EditText;

public class MyCoustomListDialog {

	public static AlertDialog createListDialog(final Context context,final String[] items,final EditText et,final getIndex index){
		AlertDialog.Builder builder=new AlertDialog.Builder(context);
		AlertDialog ad=builder.setItems(items, new OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				// TODO Auto-generated method stub
				et.setText(items[which]);
				index.getClickIndex(which);
				dialog.dismiss();
			}
		}).create();
		return ad;
	}
	
	public interface getIndex{
		public void getClickIndex(int n);
	}
}
